package com.example.myapplication1.clicktest;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

/**
 * Copyright (C), 2020, 重庆八进制有限公司
 *
 * @author: weng
 * @last-modifier: weng
 * @version: 1.0
 * @create-date: 2020/11/18 15:41
 * @last-modify-date: 2020/11/18 15:41
 * @description:
 */
public class MyRelativeLayout extends RelativeLayout {
    private static final String TAG = "MyRelativeLayout";
    public MyRelativeLayout(Context context) {
        super(context);
    }

    public MyRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {

         switch (event.getAction()){
             case MotionEvent.ACTION_DOWN:
                 Log.e("tag",TAG+"----"+"MotionEvent.ACTION_DOWN");
                 break;
             case MotionEvent.ACTION_MOVE:
                 Log.e("tag",TAG+"----"+"MotionEvent.ACTION_MOVE");
                 break;
             case MotionEvent.ACTION_UP:
                 Log.e("tag",TAG+"----"+"MotionEvent.ACTION_UP");
                 break;
         }
        return super.onTouchEvent(event);
    }
}
